package org.jeecg.modules.demo.online;

import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.demo.yxx.entity.YxxTest;
import org.jeecg.modules.demo.yxx.service.IYxxTestService;
import org.jeecg.modules.demo.yxx.service.impl.YxxTestServiceImpl;
import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaInter;
import org.jeecg.modules.online.config.exception.BusinessException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("cgformEnhanceBeanDemoYxx")
public class CgformEnhanceBeanDemoYxx implements CgformEnhanceJavaInter {
    private static final Logger logger = LoggerFactory.getLogger(CgformEnhanceBeanDemoYxx.class);

    public CgformEnhanceBeanDemoYxx() {
    }

    @Override
    public void execute(String tableName, JSONObject json) throws BusinessException {
        System.out.println("------我是自定义java增强测试bean--------");
        System.out.println("------当前tableName=>--------"+tableName);
        System.out.println("-------当前json数据=>-------"+json.toJSONString());

        YxxTestServiceImpl yxxTestService = SpringContextUtils.getBean(YxxTestServiceImpl.class);
        List<YxxTest> list = yxxTestService.list();
        System.out.println("====list===>"+list);


    }
}